import { Component, Input, OnInit } from '@angular/core';

@Component({
  selector: 'app-map-feature-info',
  templateUrl: './map-feature-info.component.html',
  styleUrls: ['./map-feature-info.component.scss']
})
export class MapFeatureInfoComponent implements OnInit {

  @Input() keys: any
  @Input() properties: any

  public data: Array<any> = []

  constructor() { }

  private dataFormate() {
    (this.keys || []).forEach(key => {
      this.data.push({
        key: key,
        value: this.properties[key]
      })
    })
  }

  ngOnInit() {
    this.dataFormate();
  }

}
